﻿CREATE proc danhmucphongBan_them        
@MaPB varchar(25),        
@TenPB nvarchar(200)    
as        
declare @dem as int        
select @dem= COUNT(*) from DanhMuc_PhongBan  where MaPB=@MaPB       
if(@dem>0)        
begin        
select ErrCode=0        
end        
else        
begin        
insert into  DanhMuc_PhongBan (MaPB,TenPB) values(@MaPB,@TenPB)        
select ErrCode=1        
end      
